import { deleteHttp, getHttp, postHttpParams } from "./index"

// 查询健康讲堂类目
export const getVideoCategoryList = () => {
    return getHttp('/health/user/video/v1/findVideoCategoryList')
}
// 回调接口
export interface VideoTilte {
    id: number;
    name: string;
  }
// 根据视频类目查询视频列表
export interface VideoVoListParams {
    categoryId: number
    page: number
    count: number
}
export const getVideoVoList = (params: VideoVoListParams) => {
    return getHttp('/health/user/video/v1/findVideoVoList', params)
}


// 收藏视频
export const addCollectVedio = (videoId: number) => {
    return postHttpParams('/health/user/video/verify/v1/addUserVideoCollection', {}, { videoId })
}

// 取消收藏

export const cancelCollectVedio = (videoId: number) => {
    return deleteHttp('/health/user/verify/v1/cancelVideoCollection', { videoId })
}

// 购买视频
export const buyVedio = (videoId: number, price: number) => {
    return postHttpParams('/health/user/video/verify/v1/videoBuy', {}, { videoId, price })
}

// 评论接口
export const getCommentVedioList = (videoId: number) => {
    return getHttp('/health/user/video/v1/findVideoCommentList', { videoId })
}

// 添加评论
export const addCommentVedio = (videoId: number, content: string) => {
    return postHttpParams('/health/user/video/verify/v1/addVideoComment', {}, { videoId, content })
}